include ../ffox.mk

TARGET = $(NAME).bin
LINK_DEFS = link_stm32f10x_MD.ld

CSRCS=	ffox.c servo.c

LIBS=	../freertos/librtos.a ../nav/libnav.a ../picoc/libpicoc.a ../stm32lib/libstm32.a ../stm32core/libstm32core.a ../stm32core/startup_stm32f10x.o 

OBJS := $(CSRCS:%.c=%.o) $(ASMSRCS:%.s=%.o)

all: $(TARGET)

$(TARGET): $(OBJS) $(LINK_DEFS) $(LIBS)
	$(LD) $(LFLAGS) -o $(NAME).out $(OBJS) $(LIBS)
	$(OBJCP) $(OBJCPFLAGS) $(NAME).out $(TARGET)

clean:
	rm -f $(TARGET) $(OBJS)

depend:
	$(CC) $(CFLAGS) -MM $(CSRCS) >.depend

-include .depend

